package com.rocketmq.c.listener;


import com.alibaba.fastjson.JSON;
import com.rocketmq.c.domain.MsgModel;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;


@Component
@RocketMQMessageListener(topic = "bootTagTopic",
        consumerGroup = "tag-consume-group",
        selectorType = SelectorType.TAG,
        selectorExpression = "tagA || tagB ")
public class TagBootMsgListener implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt msgExt) {
        System.out.println("开始消费 - TagBootMsgListener");
        System.out.println(new String(msgExt.getBody()));
        System.out.println("key:"+msgExt.getKeys());
    }
}
